package com.telit.dispose.controller.resourceManagement;

import com.telit.common.entity.DataReturn;
import com.telit.dispose.dto.ResourceConfigImgDTO;
import com.telit.dispose.service.resourceManagement.FireImgService;
import com.telit.dispose.vo.resourceManagement.FireConfigImgVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;


/**
 * Create by Chencf 2022/10/15
 */

@Api(tags = "资源图标相关接口")
@RestController
@RequestMapping("/imgIcon")
public class FireImgController {

    @Autowired
    private FireImgService fireImgService;


    @ApiOperation("01-->根据图片类型获取图片资源")
    @GetMapping("/findImgByImgType")
    public DataReturn<List<FireConfigImgVO>> findImgByImgType(@RequestParam("imgType") Integer imgType) {
        List<FireConfigImgVO> fireConfigImgVOS = fireImgService.findImgByImgType(imgType);
        return DataReturn.ok(fireConfigImgVOS);
    }


    @ApiOperation("02-->上传资源图标和地图图标")
    @PostMapping("/uploadImg")
    public DataReturn uploadImg(@RequestBody ResourceConfigImgDTO resourceConfigImgDTO) {
      fireImgService.uploadImg(resourceConfigImgDTO);
        return DataReturn.ok();
    }


}
